<?php include "../public/header.php";?>
<?php include "../public/header_edit.php";?>
<style>
    #port_hui_dom td{text-align: center!important;}
    #port_hui_dom td:nth-child(1){width: 140px}
    #port_hui_dom td:nth-child(2){width: 35%}
    #port_hui_dom td:nth-child(3){width: 140px}
    .add_hang{text-align: center;line-height: 40px}
    .add_hang:hover{color: #2272eb!important;}

    #port_an_dom td{text-align: center!important;}
    #port_an_dom td:nth-child(1){width: 140px}
</style>
<body id="optPage">
<form class="layui-form layui-form-pane" id="commentForm">
    <div class="page-title"><div class="page-title-con"><span>编辑工作复盘及安排</span><div class="move_title"></div><?php include "../public/sub.php";?></div></div>
    <div class="main-container">

        <div class="block-generic">
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label">申请人</label>
                        <div class="layui-input-block">
                            <input type="text" id="flowuser" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label">申请部门</label>
                        <div class="layui-input-block">
                            <input type="text" id="flowdept" readonly placeholder="请输入" autocomplete="off" class="layui-input readonly">
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label"><text>*</text>标题</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" id="title" placeholder="请输入" clearable  autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 170px">标题格式</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div>
                                <p>示例：</p>
                                <p>2025年5月第一周周复盘及5月第二周周工作安排</p>
                                <p>2025年5月前两周周复盘及5月后两周周工作安排</p>
                                <p>2025年5月后两周周复盘及6月前两周周工作安排</p>
                                <p>2025年5月月复盘及6月月工作安排</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>工 作 复 盘</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 169px">目 的</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div >
                                <p>①明确复盘对象：明确要复盘工作的具体内容、时间、重点以及要达到的效果等，以便有针对性地开展复盘；</p>
                                <p>②梳理全过程：发现或提出过程中存在的问题；</p>
                                <p>③分析问题，找出原因：对工作中出现的各种问题进行分析，进而找出问题的根本原因；</p>
                                <p>④制定改进方案，并对改进方案进行跟进：根据问题分析的原因，制定相应的、具体的改进措施，并对该措施的实施过程进行调整与优化，以确保该措施效果的实现；</p>
                                <p>⑤汲取教训、总结经验：对复盘的整个过程进行反思与总结，并提炼成方法论与规律，为以后工作提供参考与借鉴。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 140px">原 则</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div >
                                <p>①开放与空杯心态：摒弃自我意识，兼听不同意见，发现深层次原因；</p>
                                <p>②坦诚与信任表达：敢于接受不利后果与事情真相；</p>
                                <p>③客观与实事求是：探清事情失败与成功的主客观原因，偶必然因素；</p>
                                <p>④批评与自我批评：深刻反思，否定自我。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 83px">要 求</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div >
                                <p>不是追究责任、开批判会；不是强调客观、推卸责任；</p>
                                <p>是求真：实事求是；求实：内容与找原因；求学：改进与提高；求内：反思与自我剖析；求道：探寻本质与总结规律；求优：优化流程与简化方式。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label" style="height: 53px"><text>*</text>复盘类型</label>
                        <div class="layui-input-block">
                            <div id="huilei"></div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label" style="height: 53px"><text>*</text>复盘周期</label>
                        <div class="layui-input-block" style="width: calc(50% - 103.5px);margin-left: 0!important;float: left">
                            <input type="text" name="zhoustartdt" id="zhoustartdt" readonly placeholder="请选择" clearable  autocomplete="off" class="layui-input bdate_ymdhi">
                        </div>
                        <div style="float: left;line-height: 53px;margin-left: 14px">至</div>
                        <div class="layui-input-block" style="width: calc(50% - 103.5px);margin-left: 14px!important;float: left">
                            <input type="text" name="zhouenddt" id="zhouenddt" readonly placeholder="请选择" clearable  autocomplete="off" class="layui-input bdate_ymdhi">
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item"><div class="layui-row layui-col-space10" style="height: 40px"></div></div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10" id="port_hui_dom"></div>
            </div>
            <div class="layui-form-item"><div class="layui-row layui-col-space10" style="height: 40px;text-align: center">
                    <span class="colorlan add_hang"onclick="add_hang_port_hui(this)">+增加一条+</span>
                </div></div>




            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>工 作 安 排</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 140px">目 的</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div >
                                <p>①明确具体工作内容：工作内容必须是具体的、可以衡量的、可以达到的、有明确截止期限的，且与其他具体工作具有关联性；</p>
                                <p>②预见性风险预判：对可能出现的不利情况、可能存在的风险进行预判；</p>
                                <p>③预见性的制定科学预案：根据工作中可能会出现的困难、障碍、偏差、缺点等，制定明确的具体办法与措施，避免发生问题时陷于被动；</p>
                                <p>④过程及时做动态优化与调整：在工作执行过程中，应不断对过程进行检察和跟进，及时优化与调整。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 169px">原 则</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div >
                                <p>①局部服从全局：全局利益为重，反对本位主义；</p>
                                <p>②切实可行：从实际情况出发明确具体目标、任务与标准；</p>
                                <p>③集思广益：汇集多方意见，反对主观臆断、反对独断专行、反对闭门造车；</p>
                                <p>④突出重点：理清轻重缓急，突出重点，不能以点盖面、以偏概全、芝麻西瓜一把抓；</p>
                                <p>⑤防患于未然：对未来可能发生的“意外”，必须有预防性与解决性措施。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 140px">要 求</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div >
                                <p>①工作安排不是写出来的，而是做出来的；</p>
                                <p>②工作安排的内容远比形式重要，要拒绝形式主义；</p>
                                <p>③工作安排要求简明扼要、具体明确、用词造句力求精准，不可含糊其辞；</p>
                                <p>④工作安排应具有极强的预见性、操作性、针对性、时效性、有序性、落地性等。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>





            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md6">
                        <label class="layui-form-label"><text>*</text>安排类型</label>
                        <div class="layui-input-block">
                            <div id="anlei"></div>
                        </div>
                    </div>
                    <div class="layui-col-md6">
                        <label class="layui-form-label" style="height: 53px">安排周期</label>
                        <div class="layui-input-block"
                             style="width: calc(50% - 103.5px);margin-left: 0!important;float: left">
                            <input type="text" name="paistartdt" id="paistartdt" readonly placeholder="请选择" clearable
                                   autocomplete="off" class="layui-input bdate_ymdhi">
                        </div>
                        <div style="float: left;line-height: 53px;margin-left: 14px">至</div>
                        <div class="layui-input-block"
                             style="width: calc(50% - 103.5px);margin-left: 14px!important;float: left">
                            <input type="text" name="paienddt" id="paienddt" readonly placeholder="请选择" clearable
                                   autocomplete="off" class="layui-input bdate_ymdhi">
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item"><div class="layui-row layui-col-space10" style="height: 40px"></div></div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10" id="port_an_dom"></div>
            </div>
            <div class="layui-form-item"><div class="layui-row layui-col-space10" style="height: 40px;text-align: center">
                    <span class="colorlan add_hang"onclick="add_hang_port_an(this)">+增加一条+</span>
                </div></div>







            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="edittits"><span>分享</span></div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label" style="height: 55px">目的</label>
                        <div class="layui-input-block" style="background-color: #fafafa;color:#909399">
                            <div >
                                <p>通过分享信息、资讯、知识、想法、读书笔记等，以达到树立正确的世界观、价值观、人生观等；改变个人认知水平、思维逻辑方式、不精准的措辞表达等；掌握科学的方法论、健康的职业心态等；培养驾驭情绪的能力、适合本岗位的职业性格等目的。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">分享主题</label>
                        <div class="layui-input-block">
                            <input type="text" name="zhuti" id="zhuti" placeholder="填写资讯标题或书籍名称，如：《人类简史》或《人类简史》阅读体会。" clearable autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label label_textarea">原文摘抄</label>
                        <div class="layui-input-block">
                            <textarea id="fenrong" name="fenrong" placeholder="请输入" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label label_textarea">读书感悟</label>
                        <div class="layui-input-block">
                            <textarea id="ganwu" name="ganwu" placeholder="请输入" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
            </div>

            <div class="layui-form-item height_auto">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label label_textarea">备注</label>
                        <div class="layui-input-block">
                            <textarea id="explain" name="explain" placeholder="请输入" class="layui-textarea"></textarea>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-row layui-col-space10">
                    <div class="layui-col-md12">
                        <label class="layui-form-label">关联流程</label>
                        <div class="layui-input-block">
                            <input type="text" readonly name="flowrelas" class="layui-input flowrelas" onclick="openPage('../public/choose_flowrelas.php?dom=flowrelas','80%','80%');">
                            <div class="choose_div" id="flowrelas" key="1"></div>
                            <span class="choose_one" onclick="openPage('../public/choose_flowrelas.php?dom=flowrelas','80%','80%');"><i class="layui-icon layui-icon-search"></i></span>
                        </div>
                    </div>
                </div>
            </div>
            <?php include '../public/upinfo.php'?>
        </div>


    </div>
</form>
<script>
    var param_id = getQueryVariable('id') || 0;

    $("#commentForm").validate({
        rules: {
            title: {required: true},
            zhoustartdt: {required: true},
            zhouenddt: {required: true},
        },
        messages:{
            title: {required: "请输入"},
            zhoustartdt: {required: "请选择"},
            zhouenddt: {required: "请选择"},
        }
    });

    layui.use(['laytp', 'form'], function() {
        var form = layui.form, layer = layui.layer;
        render_input_attr();

        facade.ajax({type: 'get', url: ask_port_edit, data:{id:param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                $("#flowuser").val(data.flowuser);
                $("#flowdept").val(data.flowdept);
                $("#con").val(data.con);



                $("#title").val(data.title);
                $("#zhoustartdt").val(data.zhoustartdt);
                $("#zhouenddt").val(data.zhouenddt);
                $("#paistartdt").val(data.paistartdt);
                $("#paienddt").val(data.paienddt);
                $("#fenrong").val(data.fenrong);
                $("#zhuti").val(data.zhuti);
                $("#ganwu").val(data.ganwu);
                $("#explain").val(data.explain);


                xmselect_dan('huilei', res.data.huilei, data.huilei, function (res) {
                    if(res.arr && res.arr.length > 0){
                        $("#huilei").find('xm-select').removeClass('error');
                    }else{
                        $("#huilei").find('xm-select').addClass('error');
                    }
                });

                xmselect_dan('anlei', res.data.anlei, data.anlei, function (res) {
                    if(res.arr && res.arr.length > 0){
                        $("#anlei").find('xm-select').removeClass('error');
                    }else{
                        $("#anlei").find('xm-select').addClass('error');
                    }
                });



                var list_hui = res.data.list_hui;
                if(list_hui.length > 0){
                    for (var key in list_hui){
                        var str = '';
                        str += '<table class="layui-table port_hui_table">';
                        str += '<thead>';

                        str += '<tr>';
                        str += '<td rowspan="7" style="width: 50px!important;">';
                        str += '<div class="hangxuhao">1</div>';
                        str += '<div class="colorhong" style="margin-top: 10px;font-size: 12px!important;" onclick="shan_hang_port_hui(this)">删除</div>';
                        str += '</td>';
                        str += '</tr>';

                        str += '<tr><td>原定工作计划</td><td colspan="3"><input type="text" value="'+list_hui[key].shi+'" class="layui-input shi" placeholder="请输入"></td></tr>';

                        str += '<tr>';
                        str += '<td>原定完成时间</td><td><input type="text" class="layui-input wandt bdate_ymdhi" value="'+list_hui[key].wandt+'" readonly placeholder="请选择"></td>';
                        str += '<td>达成结果</td>';
                        str += '<td>';
                        str += '<div class="radio-block">';

                        var wanqingnamess = get_rand_xm_classname('wanqing');
                        if(list_hui[key].wanqing == '完成'){
                            str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="完成" title="完成" checked>';
                            str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="未完成" title="未完成">';
                        }else if(list_hui[key].wanqing == '未完成'){
                            str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="完成" title="完成">';
                            str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="未完成" title="未完成" checked>';
                        }else{
                            str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="完成" title="完成">';
                            str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="未完成" title="未完成">';
                        }
                        str += '</div>';
                        str += '</td>';
                        str += '</tr>';

                        str += '<tr>';
                        str += '<td>复盘中存在的问题</td>';
                        str += '<td colspan="3"><textarea class="layui-textarea cunwen" placeholder="请输入">'+list_hui[key].cunwen+'</textarea></td>';
                        str += '</tr>';

                        str += '<tr>';
                        str += '<td><p>通过复盘</p><p>汲取失败教训</p></td>';
                        str += '<td colspan="3"><textarea class="layui-textarea xixun" placeholder="请输入">'+list_hui[key].xixun+'</textarea></td>';
                        str += '</tr>';

                        str += '<tr>';
                        str += '<td>改进方案</td>';
                        str += '<td colspan="3"><textarea class="layui-textarea gaifang" placeholder="请输入">'+list_hui[key].gaifang+'</textarea></td>';
                        str += '</tr>';

                        str += '<tr>';
                        str += '<td><p>通过复盘</p><p>总结成功经验</p></td>';
                        str += '<td colspan="3"><textarea class="layui-textarea tongyan" placeholder="请输入">'+list_hui[key].tongyan+'</textarea></td>';
                        str += '</tr>';

                        str += '</thead>';
                        str += '<tbody class="short_table_tbody" id="list_port_hui"></tbody>';
                        str += '</table>';

                        $("#port_hui_dom").append(str);
                    }
                    xuhao_hang_port_hui();
                }else{
                    add_hang_port_hui();
                }





                var list_an = res.data.list_an;
                if(list_an.length > 0){
                    for (var key in list_an){
                        var str = '';
                        str += '<table class="layui-table port_an_table">';
                        str += '<thead>';

                        str += '<tr>';
                        str += '<td rowspan="5" style="width: 50px!important;">';
                        str += '<div class="hangxuhao">1</div>';
                        str += '<div class="colorhong" style="margin-top: 10px;font-size: 12px!important;" onclick="shan_hang_port_an(this)">删除</div>';
                        str += '</td>';
                        str += '</tr>';

                        str += '<tr><td>工作安排内容</td><td><input type="text" class="layui-input shi" value="'+list_an[key].shi+'" placeholder="请输入"></td></tr>';
                        str += '<tr><td>预计完成时间</td><td><input type="text" class="layui-input wandt bdate_ymdhi" value="'+list_an[key].wandt+'" readonly placeholder="请选择"></td></tr>';
                        str += '<tr><td>风险预判</td><td><textarea class="layui-textarea fengpan" placeholder="请输入">'+list_an[key].fengpan+'</textarea></td></tr>';
                        str += '<tr><td>预案制定</td><td><textarea class="layui-textarea yuzhi" placeholder="请输入">'+list_an[key].yuzhi+'</textarea></td></tr>';

                        str += '</thead>';
                        str += '<tbody class="short_table_tbody" id="list_port_an"></tbody>';
                        str += '</table>';

                        $("#port_an_dom").append(str);
                    }
                    xuhao_hang_port_an();
                }else{
                    add_hang_port_an();
                }



                update_refresh_row_func();
                public_upload_file_load('upload_files', res.data.files);
                render_from();
                initParseMoney();
            }
        });


        form.on('submit(add)', function(data){
            data.field.flowrelas = get_choose_val('flowrelas');

            var validRes = $("#commentForm").valid();

            if(!data.field.huilei){
                $("#huilei").find('xm-select').addClass('error');
                validRes = false;
            }else{
                $("#huilei").find('xm-select').removeClass('error');
            }

            if(!data.field.anlei){
                $("#anlei").find('xm-select').addClass('error');
                validRes = false;
            }else{
                $("#anlei").find('xm-select').removeClass('error');
            }

            if(!validRes){return false;}



            var list_hui = [''];
            try {
                $('#port_hui_dom table').each(function (i) {
                    var shi = $(this).find('.shi').val();
                    var wandt = $(this).find('.wandt').val();
                    var wanqing = $(this).find("input[datakey='wanqing']:checked").val() || '';
                    var cunwen = $(this).find('.cunwen').val();
                    var xixun = $(this).find('.xixun').val();
                    var gaifang = $(this).find('.gaifang').val();
                    var tongyan = $(this).find('.tongyan').val();

                    var index = i + 1;
                    if(!shi && !wandt && !wanqing && !cunwen && !xixun && !gaifang && !tongyan){
                        return false;
                    }

                    list_hui.push({
                        shi:shi,
                        wandt:wandt,
                        wanqing:wanqing,
                        cunwen:cunwen,
                        xixun:xixun,
                        gaifang:gaifang,
                        tongyan:tongyan,
                    });
                });
            } catch(e) {
                return false;
            }
            data.field.list_hui = list_hui;


            var list_an = [''];
            try {
                $('#port_an_dom table').each(function (i) {
                    var shi = $(this).find('.shi').val();
                    var wandt = $(this).find('.wandt').val();
                    var fengpan = $(this).find('.fengpan').val();
                    var yuzhi = $(this).find('.yuzhi').val();

                    var index = i + 1;
                    if(!shi && !wandt && !fengpan && !yuzhi){
                        return false;
                    }

                    list_an.push({
                        shi:shi,
                        wandt:wandt,
                        fengpan:fengpan,
                        yuzhi:yuzhi,
                    });
                });
            } catch(e) {
                return false;
            }
            data.field.list_an = list_an;


            for (var sss in data.field){
                if(!isNaN(sss)){
                    delete data.field[sss];
                }
            }

            data.field.id = param_id;
            data = parseMoney(data);
            data.field.files = public_upload_file_value('upload_files');
            facade.ajax({url: ask_port_edit, data:data.field}).done(function(res){
                if (res.code === 2000) {
                    dataPostTimeOut();
                }
            });
            return false;
        });

    });




    function shan_hang_port_hui(obj) {
        layer.confirm("<div class='tit'>确定要删除此条数据吗？</div>", {
                title:'操作确认',
                icon: 3,
                area:['450px','220px'],
                btn:['确定']
            }, function(conindex){
                $(obj).parents('.port_hui_table').remove();
                if($("#port_hui_dom").children('table').length < 1){
                    add_hang_port_hui()
                }else{
                    xuhao_hang_port_hui();
                }
                layer.close(conindex)
            }
        )
    }
    function add_hang_port_hui() {
        var str = '';
        str += '<table class="layui-table port_hui_table">';
        str += '<thead>';

        str += '<tr>';
        str += '<td rowspan="7" style="width: 50px!important;">';
        str += '<div class="hangxuhao">1</div>';
        str += '<div class="colorhong" style="margin-top: 10px;font-size: 12px!important;" onclick="shan_hang_port_hui(this)">删除</div>';
        str += '</td>';
        str += '</tr>';

        str += '<tr><td>原定工作计划</td><td colspan="3"><input type="text" class="layui-input shi" placeholder="请输入"></td></tr>';

        str += '<tr>';
        str += '<td>原定完成时间</td><td><input type="text" class="layui-input  wandt bdate_ymdhi" readonly placeholder="请选择"></td>';
        str += '<td>达成结果</td>';
        str += '<td>';
        str += '<div class="radio-block">';

        var wanqingnamess = get_rand_xm_classname('wanqing');
        str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="完成" title="完成" checked>';
        str += '<input type="radio" name="'+wanqingnamess+'" datakey="wanqing" lay-skin="primary" value="未完成" title="未完成">';

        str += '</div>';
        str += '</td>';
        str += '</tr>';

        str += '<tr>';
        str += '<td>复盘中存在的问题</td>';
        str += '<td colspan="3"><textarea class="layui-textarea cunwen" placeholder="请输入"></textarea></td>';
        str += '</tr>';

        str += '<tr>';
        str += '<td><p>通过复盘</p><p>汲取失败教训</p></td>';
        str += '<td colspan="3"><textarea class="layui-textarea xixun" placeholder="请输入"></textarea></td>';
        str += '</tr>';

        str += '<tr>';
        str += '<td>改进方案</td>';
        str += '<td colspan="3"><textarea class="layui-textarea gaifang" placeholder="请输入"></textarea></td>';
        str += '</tr>';

        str += '<tr>';
        str += '<td><p>通过复盘</p><p>总结成功经验</p></td>';
        str += '<td colspan="3"><textarea class="layui-textarea tongyan" placeholder="请输入"></textarea></td>';
        str += '</tr>';

        str += '</thead>';
        str += '<tbody class="short_table_tbody" id="list_port_hui"></tbody>';
        str += '</table>';

        $("#port_hui_dom").append(str);
        xuhao_hang_port_hui();
    }
    function xuhao_hang_port_hui() {
        $.each($("#port_hui_dom").children('table'),function (key,val) {
            $(this).find('.hangxuhao').html(key+1);
        });
        render_date();
        render_from();
    }




    function shan_hang_port_an(obj) {
        layer.confirm("<div class='tit'>确定要删除此条数据吗？</div>", {
                title:'操作确认',
                icon: 3,
                area:['450px','220px'],
                btn:['确定']
            }, function(conindex){
                $(obj).parents('.port_an_table').remove();
                if($("#port_an_dom").children('table').length < 1){
                    add_hang_port_an()
                }else{
                    xuhao_hang_port_an();
                }
                layer.close(conindex)
            }
        )
    }
    function add_hang_port_an() {
        var str = '';
        str += '<table class="layui-table port_an_table">';
        str += '<thead>';

        str += '<tr>';
        str += '<td rowspan="5" style="width: 50px!important;">';
        str += '<div class="hangxuhao">1</div>';
        str += '<div class="colorhong" style="margin-top: 10px;font-size: 12px!important;" onclick="shan_hang_port_an(this)">删除</div>';
        str += '</td>';
        str += '</tr>';

        str += '<tr><td>工作安排内容</td><td><input type="text" class="layui-input shi" placeholder="请输入"></td></tr>';
        str += '<tr><td>预计完成时间</td><td><input type="text" class="layui-input wandt bdate_ymdhi" readonly placeholder="请选择"></td></tr>';
        str += '<tr><td>风险预判</td><td><textarea class="layui-textarea fengpan" placeholder="请输入"></textarea></td></tr>';
        str += '<tr><td>预案制定</td><td><textarea class="layui-textarea yuzhi" placeholder="请输入"></textarea></td></tr>';

        str += '</thead>';
        str += '<tbody class="short_table_tbody" id="list_port_an"></tbody>';
        str += '</table>';

        $("#port_an_dom").append(str);
        xuhao_hang_port_an();
    }
    function xuhao_hang_port_an() {
        $.each($("#port_an_dom").children('table'),function (key,val) {
            $(this).find('.hangxuhao').html(key+1);
        });
        render_date();
        render_from();
    }

</script>
</body>
</html>
